package readfile;


/**
 * Created by 瀚文 on 2016/11/15.
 */
public class GetDoubleArray {
    public static double[] Integers2Doubles(int[] raw) {
        double[] res = new double[raw.length];
        for (int i = 0; i < res.length; i++) {
            res[i] = raw[i];
        }
        return res;
    }
    //根据wav文件生成double数组
    public static double[] GetDoubles(String filename){
        double[] dataDoubles = null;
        WavDataParsing reader = new WavDataParsing(filename);
        if(reader.isSuccess()) {
            int[] data = reader.getData();
            dataDoubles = Integers2Doubles(data);
        }
        return dataDoubles;
    }

}
